-
Notifications
You must be signed in to change notification settings - Fork 909
[cryptotest] Fix some failing RSA verify cryptotests #28655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this, @nasahlpa.
When I apply the changes from my comments, the failing test vectors from before are now passing, but I'm seeing a new failure in (at least) the first test vector of sw/host/cryptotest/testvectors/data/wycheproof_rsa_pss_3072_shake128.json. I see that this is documented in #28656 - is this intended to be fixed in a separate PR?
The wycheproof testvector seem to have a leading 0. This means that a 512-byte modulo for RSA-4096 is actually 513-byte. Currently, the test framework fails because it expects a 512-byte value. Remove this leading 0. Signed-off-by: Pascal Nasahl <[email protected]>
06e3ab9 to
d0ddb49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, probably needs to be backported to earlgrey_1.0.0 as well?
Is the intention to fix the remaining RSA test failures in #28656 (and thus the failures in //sw/device/tests/crypto/cryptotest:rsa_kat) in separate PRs?
|
Thanks for the review, Alex! Yes, the intention is to fix this in upcoming PRs and in the meanwhile track the failing tests in #28656. |
Some tests in the wycheproof test vector set are error tests. In one of these error tests, a larger signature (514 instead of 512-bytes) is sent to the DUT. However, we currently limit the signature payload to 512- bytes, letting the test fail. The solution to this is simple, increase the max. number of signature bytes to 512-bytes. The CL now gets this 514-byte signature and internally fails, as expected by the test. Signed-off-by: Pascal Nasahl <[email protected]>
d0ddb49 to
9ab2711
Compare
|
Which tests does this fix? |
For the first commit:
However, for RSA-4096, n is actually 513-bytes because of the leading 0.
For the second commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks @nasahlpa.
|
Successfully created backport PR for |
This PR fixes two different test failures:
Those failures are not related to bugs in the cryptolib but in the cryptotest framework.